#include <bits/stdc++.h>
#include <utility>
using namespace std;

//slow指向处理好的尾部，fast指向未处理的起始地方

class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        if(nums.size()<=1) return;
        int slow = 0;
        int fast = 0;
        while(fast < nums.size()){
            if(nums[fast]){
                swap(nums[fast], nums[slow]);
                ++slow;
            }
            ++fast;
        }
    }
};